// @ts-check
/**
 * @type {import('vitepress').UserConfig}
 */
 module.exports = {
  base: '/compasses-plan-doc/',
  title: 'Compasses Plan',
  lang: 'zh-CN',
  description: '圆规计划管理系统后台',
  head: createHead(),
  alias: '',
  themeConfig: {
    repo: 'cockroach-bully-i/compassess-plan',
    docsRepo: 'cockroach-bully-i/compasses-plan-doc',
    logo: '/logo.png',
    docsBranch: 'main',
    editLinks: true,
    editLinkText: '',
    nav: createNav(),
    sidebar: createSidebar(),
  },
};

/**
 * @type {()=>import('vitepress').HeadConfig[]}
 */

function createHead() {
  return [
    ['meta', { name: 'author', content: 'Guitar String Team' }],
    [
      'meta',
      {
        name: 'keywords',
        content: 'compasses, vitejs, vite, ant-design, vue',
      },
    ],
    ['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
    [
      'meta',
      {
        name: 'viewport',
        content:
          'width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no',
      },
    ],
    ['meta', { name: 'keywords', content: 'compasses plan docs' }],
    ['link', { rel: 'icon', href: '/favicon.svg' }],
  ];
}

/**
 * @type {()=>import('./theme-default/config').DefaultTheme.NavItem[]}
 */
function createNav() {
  return [
    {
      text: '项目配置',
      link: '/projectConfig/',
      items: [
        {
          text: '项目介绍',
          link: '/projectConfig/introduction'
        },
        {
          text: '项目规范工具',
          link: "/projectConfig/normsLint"
        },
      ],
    },
    {
      text: '项目组件',
      link: '',
      items: [
        {
          text: '全局组件',
          link: '',
        },
      ],
    },
    {
      text: '相关依赖作用',
      items: [
        {
          text: 'React系',
          link: '',
        },
      ],
    },
  ];
}

function createSidebar() {
  return {
    '/projectConfig/': [
      {
        text: '开始',
        children: [
          {
            text: '项目介绍',
            link: '/projectConfig/introduction',
          },
          {
            text: '项目规范工具',
            link: '/projectConfig/normsLint',
          },
        ],
      },
      {
        text: '版本功能迭代记录',
        children: [
         
        ],
      },
      {
        text: '其他',
        children: [
          
        ],
      },
    ],
  };
}

// /**
//  * @type {(namespace:string,items:string[])=>string[]}
//  */
// function urlWrapper(namespace, items) {
//   return items.map((item) => namespace + item);
// }

// function getGuildNav() {
//   return urlWrapper('/guide', ['/']);
// }
